package rpc.core;

import org.springframework.beans.factory.FactoryBean;

/*********
 *
 *
 *@author 197
 *@date 2020/7/10 14:41
 *
 **/


public class RefererProxyFactory<T> implements FactoryBean<T> {

  private Class<T> interfaceClass;

  public Class<T> getInterfaceClass() {
    return interfaceClass;
  }

  public void setInterfaceClass(Class<T> interfaceClass) {
    this.interfaceClass = interfaceClass;
  }

  @Override
  public T getObject() throws Exception {
    return new RefererProxy<T>().bind(interfaceClass);
  }

  @Override
  public Class<?> getObjectType() {
    return interfaceClass;
  }
}
